<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .weatcher{
            font-size: 32px;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div id="test">
    </div>
    <script src="./js/react.development.js" crossorigin></script> 
    <script src="./js/react-dom.development.js" crossorigin></script>
    <script src="./js/babel.min.js"></script>
    <script src="./js/prop-types.js"></script>
    <script type="text/babel">
        class Demo extends React.Component{
            showData = () => {
                alert(this.input.value)
            }
            showBlur = () => {
                alert(this.input2.value)
            }
            
            render(){
                return (
                    <div>
                        <input ref={(currentNode) => {this.input = currentNode}} type="text" placeholder="点击按钮提示" />&nbsp;
                        <button onClick={this.showData}>点我提示左侧的数据</button>&nbsp;
                        <input onBlur={this.showBlur} ref={(currentNode) => {this.input2 = currentNode}} type="text" placeholder="失去焦点提示" />&nbsp;
                    </div>
                )
            }
        }

        ReactDOM.render(<Demo />,document.getElementById('test'))

        /**
         * 回调ref中回调执行次数的问题
         * 
         * 
        */
    </script>
</body>
</html>